package demo.access.modifier;

public class AccessModifierClass {
	public static void main(String[] args)
	{
		PublicClass pubC = new PublicClass();
		ProtectedClass proC = new ProtectedClass();
		PrivateClass priC = new PrivateClass();
		System.out.println("In tai ham main");
		
		System.out.println(pubC.pub);
		pubC.print();
		
		System.out.println(proC.pro);
		proC.print();
		
//		System.out.println(priC.pri);
//		priC.print();
		
		System.out.println("===============");
		
		AccessModifierClass amc = new AccessModifierClass();
		amc.pintInner();
	}
	
	public void pintInner()
	{
		InnerClass inner = new InnerClass();
		inner.print();
	}
	
	void asd()
	{
		System.out.println("asd");
	}
	
	class InnerClass{
		public void print()
		{
			System.out.println("\nIn tai inner class");
			PublicClass pubC = new PublicClass();
			ProtectedClass proC = new ProtectedClass();
			PrivateClass priC = new PrivateClass();
			
			System.out.println(pubC.pub);
			pubC.print();
			
			System.out.println(proC.pro);
			proC.print();
//			System.out.println(priC.pri);
//			priC.print();
		}
	}
}

class PublicClass {
	public String pub = "day la bien public";
	public void print()
	{
		System.out.println("Day la ham public");
	}
}

class ProtectedClass{
	protected String pro = "Day la bien protected";
	String asd = "asd";
	protected void print()
	{
		System.out.println("Day la ham protected");
	}
	
	
}

class PrivateClass{
	private String pri = "Day la bien private";
	private void print()
	{
		System.out.println("Day la ham private");
		
	}
}
